package com.yc.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 测评题目实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("testQuestions")
public class TestQuestion {
    
    @TableId(value = "questionId", type = IdType.AUTO)
    private Long questionId;
    
    @TableField("testId")
    private Long testId;
    
    @TableField("questionText")
    private String questionText;
    
    @TableField("questionDescription")
    private String questionDescription;
    
    @TableField("questionType")
    private String questionType;
    
    @TableField("sortOrder")
    private Integer sortOrder;
    
    @TableField("isReverse")
    private Integer isReverse; // 0-正向计分, 1-反向计分
    
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    // 非数据库字段：关联信息
    @TableField(exist = false)
    private List<TestOption> options;
    
    // 前端需要的字段格式
    @TableField(exist = false)
    private String title; // 对应 questionText
    
    @TableField(exist = false)
    private String description; // 对应 questionDescription
} 